﻿Public Class m_equipos
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        seguridad.verificapermisos()
    End Sub

   

    Protected Sub ImageButton4_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton4.Click
        ASPxGridViewExporter1.WritePdfToResponse()
    End Sub

    Protected Sub ImageButton5_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton5.Click
        ASPxGridViewExporter1.WriteXlsxToResponse()
    End Sub

    Protected Sub ASPxButton2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ASPxButton2.Click



        Dim lNewVariable As String = "INSERT INTO equipos (descripcion) values('{0}')"
        Dim query As String = String.Format(lNewVariable, txtequipo.Text)

        Dim conn As New Devart.Data.PostgreSql.PgSqlConnection(seguridad.conexion)
        conn.Open()
        Dim ejec As New Devart.Data.PostgreSql.PgSqlCommand(query, conn)
        ejec.ExecuteNonQuery()
        txtequipo.Text = ""
        ASPxGridView2.DataBind()
    End Sub

    Protected Sub ImageButton6_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton6.Click
        Dim sUrl As String = "frmRptUsuarios.aspx"
        Dim sScript As String = "<script language =javascript> "
        sScript += "window.open('" & sUrl & "',null,'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=300,left=100,top=100');"
        sScript += "</script> "
        Response.Write(sScript)
        Dim repot As New XtraRepEquipo
        repot.EquiposTableAdapter.Fill(repot.DataSet11.equipos)

    End Sub
End Class